<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>while循环</title>
</head>
<body>
    <script>
        let names = ["jack","tom","mike","rose","peter"];
        let i = 0;
        while (i < names.length){
            console.log(names[i]);
            i++;
            // if(i == names.length){
            //     break;
            // }
        }
    </script>
</body>
</html>